
 <?php
       $arr=array();
	   header("Content-Type: text/html;charset=utf-8");
	   $connect=mysql_connect("localhost","root","");
	    mysql_select_db("news",$connect);
		mysql_query("set names utf8;"); 
		$sql="select * from news where id=47";
	
		$result=mysql_query($sql);
		$row=mysql_fetch_assoc($result);
		
		$id=$row['id'];
		$title=$row['title'];
		
		$input = array("title"=>$r,"id"=>$id);
	    array_push($arr,$input);
		
	    echo json_encode($arr);
		
	
/* 	$data="邱邱";
	
	
	echo characet($data);
function characet($data){
	  if( !empty($data) ){
	    $fileType = mb_detect_encoding($data , array('UTF-8','GBK','LATIN1','BIG5')) ;
	    if( $fileType != 'UTF-8'){
	      $data = mb_convert_encoding($data ,'utf-8' , $fileType);
	    }
	  }
	  return $data;
	} */
?>